﻿/******************************************************************************
 * 【本类功能概述】                                 					      *
 *  版权所有（C）2017-20XX，米兔网络                                         *
 *  保留所有权利。                                                            *
 ******************************************************************************
 *  作者 : <hughjk>
 *  创建时间:2018年7月5日 15:52:08
 *  文件描述:属性输出类
 *****************************************************************************/

//--------------------------------------------------------------------------------------------------------------------------------------------------
//-------------------------------計算策略,只计算属性,不进行其他模块相关的操作-----------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------------------------------------------

/// <summary>
/// 數值的計算策略
/// 获取属性都通过这个类
/// </summary>
public abstract class AttrStrategy
{
    public RoleAttrBuilder m_AttrBuilder;
    
    /// <summary>
    /// 获取当前属性
    /// </summary>
    /// <param name="ptype"></param>
    /// <returns></returns>
    public abstract float GetCurAttr(AttrType ptype);

    /// <summary>
    /// 获取当前属性
    /// </summary>
    /// <returns></returns>
    public abstract Attr GetCurAttr();

    /// <summary>
    /// 受伤
    /// </summary>
    public abstract bool BeInjured(float damage);

    /// <summary>
    /// 护盾减免伤害  ref出最终伤害,ref出护盾承受的伤害  返回是否破盾瞬间
    /// </summary>
    public abstract bool Protect(ref float damage, ref float protect);

    /// <summary>
    /// 添加护盾
    /// </summary>
    public abstract void AddShield(float bV, int AttrId, float N);

    /// <summary>
    /// 护盾结束
    /// </summary>
    public abstract void ShieldOver(int AttrId, float N);

    /// <summary>
    /// Hp变化,给天赋,额外 伤害,回血使用
    /// </summary>
    public abstract bool HpChange(float value);

    /// <summary>
    /// MP变化,给天赋,额外 伤害,回血使用
    /// </summary>
    public abstract bool MpChange(float value);

    /// <summary>
    /// 是否能消耗魔法
    /// </summary>
    public abstract bool IsMpChange(float value);

    /// <summary>
    /// 是否死亡
    /// </summary>
    /// <returns></returns>
    public abstract bool IsDie();

    /// <summary>
    /// 是否暴击
    /// </summary>
    /// <param name="assign"></param>
    /// <returns></returns>
    public abstract bool isCthr(float assign = 1);

    /// <summary>
    /// 是否命中
    /// </summary>
    /// <param name="enemAtt"></param>
    /// <returns></returns>
    public abstract bool isHitRate(bool isSkill, AttrStrategy enemAtt);

    /// <summary>
    /// 普通伤害
    /// </summary>
    /// <param name="enemAtts"></param>
    /// <returns></returns>
    public abstract float NormalAttack(AttrStrategy enemAtts, float phase);

    /// <summary>
    /// 暴击伤害
    /// </summary>
    /// <param name="enemAtt"></param>
    /// <returns></returns>
    public abstract float CriticalStrikes(AttrStrategy enemAtt, float phase);

    /// <summary>
    /// 真实百分比伤害
    /// </summary>
    /// <param name="enemAtt"></param>
    /// <returns></returns>
    public abstract float TrueRatioHarm(AttrStrategy enemAtt, float Ratio);

    /// <summary>
    /// 战斗添加减少属性
    /// </summary>
    public abstract void AddAttr(int id, float v, bool isRatio);
}